package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.model.product.BaseCategoryTrademark;
import com.atguigu.gmall.model.product.BaseTrademark;
import com.atguigu.gmall.model.product.CategoryTrademarkVo;
import com.atguigu.gmall.product.mapper.BaseCategoryTrademarkMapper;
import com.atguigu.gmall.product.service.BaseCategoryTrademarkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BaseCategoryTrademarkServiceImpl implements BaseCategoryTrademarkService {

    @Autowired
    private BaseCategoryTrademarkMapper baseCategoryTrademarkMapper;

    @Override
    public List<BaseTrademark> findTrademarkList(Long category3Id) {
        List<BaseTrademark> baseTrademarkList  =baseCategoryTrademarkMapper.findTrademarkList(category3Id);

        return baseTrademarkList;
    }

    @Override
    public List<BaseTrademark> findCurrentTrademarkList(Long category3Id) {
     List<Long> id  =baseCategoryTrademarkMapper.selectId(category3Id);
        List<BaseTrademark> baseTrademarks=  baseCategoryTrademarkMapper.findCurrentTrademarkList(id);
        return baseTrademarks;
    }

    @Override
    public void saveBaseTrademark(CategoryTrademarkVo categoryTrademarkVo) {
        baseCategoryTrademarkMapper.saveBaseTrademark(categoryTrademarkVo);
    }

    @Override
    public void removeBaseTrademark(Long category3Id, Long trademarkId) {
        baseCategoryTrademarkMapper.removeBaseTrademark(category3Id,trademarkId);
    }


}
